Cosine similarity

A common Similarity measure, especially for Continuous embedding vectors.

Ranges from (opposite) to (identical direction). It ignores magnitude and only compares direction, which is the main reason it’s preferred over Euclidean distance in high-dimensional spaces where distances concentrate.

Problems

Cosine distance

Cosine similarity is often converted into a “distance”: mapping . But this inherits the resolution problem above.

Angular distance

An alternative that avoids the resolution issue:

Google’s Universal Sentence Encoder normalizes this into a similarity: